﻿Imports KanBan.Pgd.Domain.Entities
Imports KanBan.Pgd.Infrastructure.Repositories
Imports KanBan.Pgd.Domain.ValueObjects

Public Class UserService

    Public Function GetProfileById(ByVal profileId As Guid) As Profile

        Dim repository As New ProfileRepository()
        Return repository.GetById(profileId)

    End Function

    Public Function GetProfileLevelById(ByVal profileLevelId As Guid) As ProfileLevel

        Return (New ValueObjectRepository(Of ProfileLevel)).GetById(profileLevelId)

    End Function

    Public Function GetById(ByVal userId As Guid) As User

        Dim repository As New UserRepository
        Return repository.GetById(userId)

    End Function

    Public Function GetCompetencies(ByVal userId As Guid) As IList(Of UserCompetency)

        Dim repository As New UserRepository()
        Return repository.GetUserCompetencies(userId)

    End Function

    Public Sub SaveOrUpdate(ByVal user As User)

        Dim repository As New UserRepository()
        repository.SaveOrUpdate(user)

    End Sub

    Public Sub SaveOrUpdateCompetency(ByVal uc As UserCompetency)

        Dim repository As New UserRepository()
        repository.SaveOrUpdateUserCompetency(uc)

    End Sub

End Class
